package com.hzp.micromall.content.controller;


import com.hzp.micromall.common.core.api.CommonResult;
import com.hzp.micromall.content.entity.Subject;
import com.hzp.micromall.content.entity.SubjectCategory;
import com.hzp.micromall.content.service.SubjectCategoryService;
import com.hzp.micromall.content.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 专题分类表 前端控制器
 * </p>
 *
 * @author houzipeng
 * @since 2022-03-08 10:15:14
 */
@RestController
@RequestMapping("/content/subjectCate")
public class SubjectCategoryController {

    @Autowired
    private SubjectCategoryService subjectCategoryService;

    @ApiOperation("获取所有专题分类")
    @RequestMapping("/listAll")
    @ResponseBody
    public CommonResult listAll() {
        List<SubjectCategory> subjects = subjectCategoryService.listAll();
        return CommonResult.success(subjects);
    }
}

